<?php
	include '../../modules/errors/errorReporting.php';
	include '../../modules/connection/db_connect.php';
	
    $fromFlash = strip_tags($_POST['fromFlash']);
	$email = strip_tags($_POST['email']);
	$name = strip_tags($_POST['name']);
	$msg = strip_tags($_POST['msg']);
	
	$query = "INSERT INTO emails (name, email) VALUES ('$name', '$email')";
	$result = mysqli_query($connectDB, $query);
	
	//echo "email=$email&name=$name&message=$msg";
	
	$message = 'A new Message From LISO' .
		"\n" . 'Name = ' . $name .
		"\n" . 'Email = ' . $email .
		"\n" . 'Message = ' . $msg;
	
	if( $fromFlash == "conundrum" ) {
		
		mail( 'info@lookinginspeakingout.com', 'Someone sent a message from Looking In Speaking Out', $message );
		
	}
		
?>